package com.qianli.user.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/2/27
 * Time: 下午1:15
 * 认证类型
 */
public enum CreditAuthTypeEnum {
    ZM(1, "芝麻信用"),
    BANK(2, "银行卡"),
    FACE(3, "人脸识别"),
    ALIPAY(4, "支付宝"),
    CREDIT_CARD(5, "信用卡"),
    TAOBAO(6, "淘宝"),
    CARRIER(7, "运营商"),
    JD(8, "京东"),
    SOCIAL_SECURITY(9, "社保"),
    PROVIDENT_FUND(10, "公积金"),
    XUEXIN(11, "学信"),
    FACEBOOK(12, "facebook"),
    TWITTER(13, "twitter"),
    GOOGLE(14, "google"),
    ;

    private Integer type;

    private String desc;

    CreditAuthTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public CreditAuthTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public CreditAuthTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }


    public static CreditAuthTypeEnum getEnumByType(Integer type) {
        CreditAuthTypeEnum creditAuthTypeEnum = null;
        for (CreditAuthTypeEnum authTypeEnum : CreditAuthTypeEnum.values()) {
            if (authTypeEnum.getType().equals(type)) {
                creditAuthTypeEnum = authTypeEnum;
            }
        }

        return creditAuthTypeEnum;
    }
}
